﻿<UserControl x:Class="ConsoleHoster.View.Controls.ProjectDetailsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:uc="clr-namespace:ConsoleHoster.View.Controls"
             xmlns:cv="clr-namespace:ConsoleHoster.View.Converters"
             mc:Ignorable="d" d:DesignWidth="300">
    <Grid VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <TextBlock Text="Project name:" VerticalAlignment="Center" />
        <TextBox Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Text="{Binding Project.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding Path=IsNewProject, Mode=OneWay}" />

        <TextBlock Text="Executable:" VerticalAlignment="Center" Grid.Row="1" />
        <uc:TextBoxWithActionButton x:Name="tbaExecutable" Grid.Row="1" Grid.Column="1" Text="{Binding Path=Project.Executable, Mode=TwoWay, ValidatesOnExceptions=True}"/>

        <TextBlock Text="Arguments:" VerticalAlignment="Center" Grid.Row="2" />
        <TextBox Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Row="2" Text="{Binding Path=Project.Arguments, Mode=TwoWay}" />

        <TextBlock Text="Working Directory:" VerticalAlignment="Center" Grid.Row="3" />
        <uc:TextBoxWithActionButton x:Name="tbaWorkingDir" Grid.Row="3" Grid.Column="1" Text="{Binding Path=Project.WorkingDir, Mode=TwoWay, ValidatesOnExceptions=True}" />

        <TextBlock Text="Project Color:" VerticalAlignment="Center" Grid.Row="4" />
        <uc:ColorSelector Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Row="4" ColorCode="{Binding Path=ProjectColor, Mode=TwoWay}" />

        <TextBlock Text="Background:" VerticalAlignment="Center" Grid.Row="5" />
        <uc:ColorSelector Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Row="5" ColorCode="{Binding Path=BackgroundColor, Mode=TwoWay}" />

        <TextBlock Text="Foreground:" VerticalAlignment="Center" Grid.Row="6" />
        <uc:ColorSelector Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Row="6" ColorCode="{Binding Path=MessageColor, Mode=TwoWay}" />

        <TextBlock Text="ErrorColor:" VerticalAlignment="Center" Grid.Row="7" />
        <uc:ColorSelector Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Row="7" ColorCode="{Binding Path=ErrorMessageColor, Mode=TwoWay}" />

        <TextBlock Text="AutoStart:" Grid.Row="8" />
        <CheckBox VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="8" IsChecked="{Binding Path=Project.AutoLoad, Mode=TwoWay}" Grid.Column="1" />

        <TextBlock Text="Show Explorer Tree By Default:" Grid.Row="9" />
        <CheckBox VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="9" IsChecked="{Binding Path=Project.ShowExplorerTreeByDefault, Mode=TwoWay}" Grid.Column="1" />

        <TextBlock Text="Store output to file:" Grid.Row="10" />
        <CheckBox VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="10" IsChecked="{Binding Path=Project.StoreOutput, Mode=TwoWay}" Grid.Column="1" />

    </Grid>
</UserControl>
